package org.vgou.service.impl;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;
import org.vgou.dao.IBaseDao;
import org.vgou.model.User;
import org.vgou.service.IUserService;

/**
 * 
 * Copyright (c) 2011, vgou <br>
 * All rights reserved.<br>
 * 
 * @since 2010-11-27
 * @author <a href="mailto:jason.hxx@gmail.com">jason</a>
 * @version Id: UserServiceImpl.java 
 * @comment	用户服务类
 * 
 */
@Service("userService")
public class UserServiceImpl<T> implements IUserService {

	protected final Log logger = LogFactory.getLog(getClass());

	@Resource
	private IBaseDao baseDao;
	
	/**
	 * 创建用户
	 * @param user
	 * @return
	 * @throws Exception
	 */
	@Override
	public long create(User user) throws Exception {
		long id = 0;
		if(user == null)
			return id;
		try {
			id = (Long)baseDao.create(user);
		} catch (Exception e) {
			logger.error("创建用户失败：" + e.getMessage());
		}
		return id;
	}

	
}
